/*
 * ﻿Copyright (C) 2009-2013 NewMain Softech
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */
package com.newmainsoftech.gwetons.client;

public interface RegExpJsni {

	public boolean getIgnoreCase();

	public boolean getGlobal();

	public boolean getMultiline();

	public String getSource();

	/**
	 * @return index value points the character FOLLOWING the regExpObj's pattern matched last time. 
	 * Thereby, please remind that this will return 0 when the pattern of regExpObj was not found in 
	 * the last operation on regExpObj input. -1 when global flag of regExpObj has not been set. 
	 */
	public int getLastIndex();

	/**
	 * Please be advised that the return value of getInput method is unique for 
	 * each RegExpJsni instance, not like value of deprecated input property of global 
	 * JavaScript RegExp object. 
	 * @return string against what a regular expression was matched. Null when there was 
	 * no match so far.
	 */
	public String getInput();

	/**
	 * Please be advised that the return value of getLeftContext method is unique for 
	 * each RegExpJsni instance, not like value of deprecated leftContext property of global 
	 * JavaScript RegExp object. 
	 * @return substring preceding the most recent match out of string having processed by test 
	 * method or exec method.  
	 */
	public String getLeftContext();

	/**
	 * Please be advised that the return value of getLeftContext method is unique for 
	 * each RegExpJsni instance, not like value of deprecated leftContext property of global 
	 * JavaScript RegExp object. 
	 * @return
	 */
	public String getRightContext();

	/**
	 * @return (last) matched text out of string having processed by test method or exec method.  
	 * null when there was no match.
	 */
	public String getLastMatch();

	public boolean test(String inputStr);

	public String exec(String inputStr);

}